//
//  RTJDebtCalendarTwoCell.m
//  RuiTaiJinProject
//
//  Created by jayson on 2019/3/29.
//  Copyright © 2019年 leewei. All rights reserved.
//

#import "RTJDebtCalendarTwoCell.h"

@interface RTJDebtCalendarTwoCell ()

@property (weak, nonatomic) IBOutlet UILabel *titleLab;
@property (weak, nonatomic) IBOutlet UILabel *statusLab;
@property (weak, nonatomic) IBOutlet UILabel *money;
@property (weak, nonatomic) IBOutlet UILabel *rate;
@property (weak, nonatomic) IBOutlet UILabel *time;
@property (weak, nonatomic) IBOutlet UILabel *payway;
@property (weak, nonatomic) IBOutlet UILabel *rePayWay;
@property (weak, nonatomic) IBOutlet UILabel *principal;
@property (weak, nonatomic) IBOutlet UILabel *huikuanMoney;
@property (weak, nonatomic) IBOutlet UILabel *lixi;

@property (weak, nonatomic) IBOutlet UIView *bg_view1;

@property (weak, nonatomic) IBOutlet UILabel *lab1;
@property (weak, nonatomic) IBOutlet UILabel *lab2;
@property (weak, nonatomic) IBOutlet UILabel *lab3;
@property (weak, nonatomic) IBOutlet UILabel *lab4;
@property (weak, nonatomic) IBOutlet UIView *views;

@end

@implementation RTJDebtCalendarTwoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    _bg_view1.layer.cornerRadius = 5;
    _bg_view1.layer.shadowColor = [UIColor colorForHex:@"#dbc9cc"].CGColor;
    _bg_view1.layer.shadowOffset = CGSizeMake(-1, 1);
    _bg_view1.layer.shadowOpacity = 0.5;
    _bg_view1.layer.shadowRadius = 5;
}

-(void)setData:(NSDictionary *)data{
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    // 设置日期格式
    [formatter setDateFormat:@"MM"];
    // 获取当前日期
    NSDate *currentDate = [NSDate date];
    NSString *currentDateString = [formatter stringFromDate:currentDate];
    _lab1.text = [NSString stringWithFormat:@"%@月未回款",currentDateString];
    _lab2.text = [NSString stringWithFormat:@"%@元",data[@"unRepay"]];
    _lab3.text = [NSString stringWithFormat:@"%@月已回款",currentDateString];
    _lab4.text = [NSString stringWithFormat:@"%@元",data[@"already_repay"]];

    _views.hidden = _isShow;

}
-(void)setDic:(NSDictionary *)dic{
    
    _dic = dic;
    
    //    NSInteger has_repay = [dic[@"has_repay"]integerValue];
    _titleLab.text = dic[@"name"];
    _statusLab.text = dic[@"repay_status"];
    _money.text = [NSString stringWithFormat:@"出借金额：%@元",dic[@"money"]];
    _rate.text = [NSString stringWithFormat:@"预期年化：%@%@",dic[@"rate"],@"%"];
    _time.text = [NSString stringWithFormat:@"出借期限：%@个月",dic[@"repay_time"]];
    _payway.text = [NSString stringWithFormat:@"还款方式：%@",dic[@"loantype"]];
    _rePayWay.text = [NSString stringWithFormat:@"回款类型：%@",dic[@"type"]];
    _principal.text = [NSString stringWithFormat:@"本金：%@元",dic[@"self_money"]];
    _huikuanMoney.text = [NSString stringWithFormat:@"%@元",dic[@"repay_money"]];
    _lixi.text = [NSString stringWithFormat:@"利息：%@元",dic[@"interest_money"]];
        
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
